package com.tbit.uqbike.object.pojo;

import cn.hutool.core.util.DesensitizedUtil;
import com.tbit.uqbike.annos.Excel;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 用户
 *
 * @author Leon
 * 2017年4月20日 下午2:43:10
 */
@AllArgsConstructor
@NoArgsConstructor
public class User {
    /**
     * 用户id
     */
    private Integer userId;
    /**
     * 账户id
     */
    private Integer accountId;
    /**
     * 国家码
     */
    private String country;
    /**
     * 手机号码
     */
    @Excel(name = "号码", sort = 2)
    private String phone;
    /**
     * 性别
     */
    private String sex;
    /**
     * 生日
     */
    private String birthDay;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 押金状态
     */
    @Excel(name = "押金状态", readConverterExp = "0=未提交,1=押金用户", sort = 5)
    private Integer depositState;
    /**
     * 押金金额
     */
//    @Excel(name = "押金金额" ,sort =6)
    private Integer depositMoney;

    /**
     * 押金金额
     */
    @Excel(name = "押金金额", sort = 6)
    private Double depositBalance;
    /**
     * 账户金额
     */
    private Integer money;
    /**
     * 加入时间
     */
    @Excel(name = "注册时间", sort = 8)
    private String joinTime;
    /**
     * 更新时间
     */
    private String updateTime;
    /**
     * 备注
     */
    @Excel(name = "用户备注", sort = 10)
    private String remark;
    /**
     * 头像地址
     */
    private String imageUrl;
    /**
     * 身份证号码
     */
    @Excel(name = "身份证号码", sort = 3)
    private String idNO;
    /**
     * 用户真实姓名
     */
    @Excel(name = "姓名", sort = 1)
    private String name;
    /**
     * 是否实名认证
     */
    private Boolean nameAuth;
    /**
     * 是否实名认证
     */
    private Boolean studentAuth;
    /**
     * 学生证
     */
    private String studentIdNO;
    /**
     * 免押会员到期时间
     */
    private String depositDate;

    private List<GiftCard> giftCardList;

    private Integer rechargeMoney;

    private String operaPsw;
    @Excel(name = "所属品牌", sort = 9)
    private String brandName;
    @Excel(name = "余额", sort = 4)
    private Double balance;
    /**
     * 欠款金额
     */
    @Excel(name = "欠款", sort = 7)
    private int rideMoney;

    /**
     * 骑行分
     */
    private Integer ridingScore;

    /**
     * 用户基本信息脱敏
     */
    public void desensitization() {
        //信息脱敏
        setName(DesensitizedUtil.chineseName(name));
        setIdNO(DesensitizedUtil.idCardNum(idNO, 1, 2));
        //setPhone(DesensitizedUtil.mobilePhone(phone));
        setBirthDay(DesensitizedUtil.password(birthDay));
        setEmail(DesensitizedUtil.email(email));
    }


    public User(Integer userId, String phone) {
        this.userId = userId;
        this.phone = phone;
    }

    public int getRideMoney() {
        return rideMoney;
    }

    public void setRideMoney(int rideMoney) {
        this.rideMoney = rideMoney;
    }

    public Integer getRidingScore() {
        return ridingScore;
    }

    public void setRidingScore(Integer ridingScore) {
        this.ridingScore = ridingScore;
    }

    public Double getBalance() {
        return balance;
    }

    public void setBalance(Double balance) {
        this.balance = balance;
    }

    public Double getDepositBalance() {
        return depositBalance;
    }

    public void setDepositBalance(Double depositBalance) {
        this.depositBalance = depositBalance;
    }

    public String getOperaPsw() {
        return operaPsw;
    }

    public void setOperaPsw(String operaPsw) {
        this.operaPsw = operaPsw;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public Integer getRechargeMoney() {
        return rechargeMoney;
    }

    public void setRechargeMoney(Integer rechargeMoney) {
        this.rechargeMoney = rechargeMoney;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getAccountId() {
        return accountId;
    }

    public void setAccountId(Integer accountId) {
        this.accountId = accountId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getBirthDay() {
        return birthDay;
    }

    public void setBirthDay(String birthDay) {
        this.birthDay = birthDay;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getDepositState() {
        return depositState;
    }

    public void setDepositState(Integer depositState) {
        this.depositState = depositState;
    }

    public Integer getDepositMoney() {
        return depositMoney;
    }

    public void setDepositMoney(Integer depositMoney) {
        this.depositMoney = depositMoney;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public String getJoinTime() {
        return joinTime;
    }

    public void setJoinTime(String joinTime) {
        this.joinTime = joinTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getIdNO() {
        return idNO;
    }

    public void setIdNO(String idNO) {
        this.idNO = idNO;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getNameAuth() {
        return nameAuth;
    }

    public void setNameAuth(Boolean nameAuth) {
        this.nameAuth = nameAuth;
    }

    public Boolean getStudentAuth() {
        return studentAuth;
    }

    public void setStudentAuth(Boolean studentAuth) {
        this.studentAuth = studentAuth;
    }

    public String getStudentIdNO() {
        return studentIdNO;
    }

    public void setStudentIdNO(String studentIdNO) {
        this.studentIdNO = studentIdNO;
    }

    public String getDepositDate() {
        return depositDate;
    }

    public void setDepositDate(String depositDate) {
        this.depositDate = depositDate;
    }

    public List<GiftCard> getGiftCardList() {
        return giftCardList;
    }

    public void setGiftCardList(List<GiftCard> giftCardList) {
        this.giftCardList = giftCardList;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }


    @Override
    public String toString() {
        return "User [userId=" + userId + ", accountId=" + accountId + ", phone=" + phone + ", sex=" + sex + ", birthDay=" + birthDay + ", email=" + email + ", depositState=" + depositState + ", depositMoney=" + depositMoney + ", money=" + money
                + ", joinTime=" + joinTime + ", updateTime=" + updateTime + ", remark=" + remark + ", imageUrl=" + imageUrl + ", idNO=" + idNO + ", name=" + name + ", nameAuth=" + nameAuth + ", studentAuth=" + studentAuth + ", studentIdNO="
                + studentIdNO + ", depositDate=" + depositDate + "]";
    }
}
